a c++ program for task scheduling [closed]
Posted
by
scheduling
on Programmers
See other posts from Programmers
or by scheduling
Published on 2012-06-21T15:54:43Z
Indexed on
2012/06/21
21:23 UTC
Read the original article
Hit count: 147
c++
This is the code which I made but I am not able to correct the mistake in the code.
Please correct the mistake in my code.
#include<unistd.h>
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
#include<string.h>
int main()
{
char *timetoken;
char currtime[7];
char schedtime[7];
int i;
struct tm *localtimeptr;
strcpy(schedtime,"15:25:00");
while(6!=9)
{
time_t lt;
sleep(1);
lt = time(NULL);
localtimeptr = localtime(<);
timetoken=strtok(asctime(localtimeptr)," ");
for(i=1;i<5;i++)
timetoken=strtok('\0'," ");
if(i==3)
{
strcpy(currtime,timetoken);
}
}
printf("The current time is: %s\n",currtime);
printf("We are waiting for: %s\n",schedtime);
if(!strcmp(currtime,schedtime))
{
printf("Time to do stuff \n");
system("C:\PROJECT X");
}
getch();
return 0;
}
© Programmers or respective owner